<template>
  <div>
    <el-dialog title="历史续费" :visible.sync="state" @close="close" @open="open">
      <el-table :data="list" v-loading="loading">
        <el-table-column property="body" label="付费项目">
          <template slot-scope="scope">{{scope.row.product_type==1?'半年会员':'一年会员'}}</template>
        </el-table-column>
        <el-table-column property="total_fee" label="付费金额" >
          <template slot-scope="scope">{{scope.row.total_fee/100}}</template>
        </el-table-column>
        <el-table-column property="name" label="支付方式" >
          微信
        </el-table-column>
        <el-table-column property="out_trade_no" label="交易单号" ></el-table-column>
        <el-table-column property="create_time" label="支付时间"></el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>
<script>
import {getPayHistory} from "../utils/interface"
export default {
  props: {
    historyState: {
      type: Boolean,
      default: false
    },
  },
  computed: {
    state: {
      get() {
        return this.historyState;
      },
      set() {}
    }
  },
  data(){
    return {
      list:[],
      loading: true
    }
  },
  methods:{
      close(){
          this.$emit('getrenewHistory')
      },
      open(){
        this.getList()
      },
      getList(){
        getPayHistory().then(res=>{
          console.log(res.data)
          this.list = res.data.data
          this.loading = false
        })
      }
  }
};
</script>